package com.happyrecyclingstation.controller.hr;

import com.happyrecyclingstation.service.ResumeService;
import com.happyrecyclingstation.utils.Result;
import com.happyrecyclingstation.vo.HrResumeVO;
import com.happyrecyclingstation.vo.PageResult;
import com.happyrecyclingstation.vo.ResumeVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;

/**
 * 企业用户
 */
@Slf4j
@RestController("hrResumeController")
@RequestMapping("/hr/resumes")
public class ResumeController {

    @Autowired
    private ResumeService resumeService;

    /**
     * hr查询简历
     * @return
     */

    @GetMapping
    public Result getResume(Integer posId, Short isView, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createTime,
                            Integer currentPage, Integer pageSize){
        log.info("hr查询简历");
        Result result = resumeService.getResume(posId, isView, createTime, currentPage, pageSize);
        return result;
    }

    /**
     * hr查询简历详情
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    private Result getResumeById(@PathVariable("id") Integer id){
        log.info("hr查询简历详情:{}", id);
        ResumeVO resumeVo = resumeService.getResumeById(id);
        return Result.success(resumeVo);
    }
}
